package m2.port;

import m2.Composant;
import m2.service.ServiceFourni;

public class PortFourni extends PortConfigFourni {
	protected  Composant composant;
	protected  ServiceFourni serviceFourni;

	public PortFourni(String name) {
		super(name);
	}

	public ServiceFourni getServiceFournis() {
		return serviceFourni;
	}

	public void setServiceFournis(ServiceFourni serviceFournis) {
		this.serviceFourni = serviceFournis;
		serviceFournis.addObserver(this);
	}
	
	public void setComposant(Composant c){
		composant = c;
	}
	
	public Composant getComposant(){
		return composant;
	}
	
	@Override
	public void update(Object o, Object arg) {
		System.out.println("===========Composant :" + this.getComposant().getName() +"===========");
		System.out.println("Message recu: " + arg );
System.out.println("===========================================");
		notifyObservers(arg);
	}
}
